export default [
  // 学生端路由
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/Student/Home.vue') // 路由懒加载
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('@/views/Student/User.vue'),
    meta: {
      needLogin: true 
    }
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/Student/Search.vue')
  },
  {
    path: '/user/FeedBack',
    name: 'feedback',
    component: () => import('@/components/Student/user/FeedBack.vue'),
    meta: {
      needLogin: true
    }
  },
  {
    path: '/userInfo',
    name: 'UserInfo',
    component: () => import('@/components/Student/user/UserInfo.vue'),
    meta: {
      needLogin: true
    }
  },
  {
    path: '/user/Learnt',
    name: 'Learnt',
    component: () => import('@/components/Student/user/Learnt.vue'),
    meta: {
      needLogin: true
    }
  },
  {
    path: '/user/Notice',
    name: 'Notice',
    component: () => import('@/components/Student/user/Notice.vue'),
    meta: {
      needLogin: true
    }
  },
  {
    path: '/user/Collection',
    name: 'Collection',
    component: () => import('@/components/Student/user/Collection.vue'),
    meta: {
      needLogin: true
    }
  },
  {
    path: '/user/Settings',
    name: 'Settings',
    component: () => import('@/components/Student/user/Settings.vue'),
    meta: {
      needLogin: true
    }
  }, {
    path: '/user/ChangeNick',
    name: 'ChangeNick',
    component: () => import('@/components/Student/user/ChangeNick.vue'),
    meta: {
      needLogin: true
    }
  }, {
    path: '/user/ChangeGender',
    name: 'ChangeGender',
    component: () => import('@/components/Student/user/ChangeGender.vue'),
    meta: {
      needLogin: true
    }
  }, {
    path: '/user/ChangeIcon',
    name: 'ChangeIcon',
    component: () => import('@/components/Student/user/ChangeIcon.vue'),
    meta: {
      needLogin: true
    }
  }, {
    path: '/user/ChangePassword',
    name: 'ChangePassword',
    component: () => import('@/components/Student/user/ChangePassword.vue'),
    meta: {
      needLogin: true
    }
  }, {
    path: '/user/ChangePhone',
    name: 'ChangePhone',
    component: () => import('@/components/Student/user/ChangePhone.vue'),
    meta: {
      needLogin: true
    }
  }, {
    path: '/NoticeDetail/:id',
    name: 'NoticeDetail',
    component: () => import('@/components/common/NoticeDetail.vue'),
    meta: {
      needLogin: true
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue')
  },
  // 课程路由
  {
    path: '/Course/CourseInfo',
    name: 'CourseInfo',
    component: () => import('@/views/Course/CourseInfo.vue')
  },
  {
    path: '/Course/WorkList',
    name: 'UserWork',
    component: () => import('@/views/Course/WorkList.vue')

  },
  {
    path: '/user/MyCourseList',
    name: 'MyCourseList',
    component: () => import('@/views/Course/MyCourseList.vue')

  },
  {
    path: '/Course/UserCourse',
    name: 'UserCourse',
    component: () => import('@/views/Course/UserCourse.vue')

  },
  {
    path: '/Course/CourseLearning',
    name: 'CourseLearning',
    component: () => import('@/views/Course/CourseLearning.vue')

  },
  {
    path: '/Course/WorkInfoIng',
    name: 'WorkInfoIng',
    component: () => import('@/views/Course/WorkInfoIng.vue')

  },
  {
    path: '/Course/WorkInfoDone',
    name: 'WorkInfoDone',
    component: () => import('@/views/Course/WorkInfoDone.vue')

  },
  {
    path: '/user/CourseComment',
    name: 'CourseComment',
    component: () => import('@/components/Student/user/CourseComment.vue')

  },
  {
    path: '/user/CourseCollect',
    name: 'CourseCollect',
    component: () => import('@/views/Course/CourseCollect.vue')

  },
  // 管理员端路由
  {
    path: '/manage/home',
    name: 'ManageHome',
    component: () => import('@/views/Manage/Home.vue'),
    meta: {
      needLogin: true
    }
  },
  // 教师端路由
  {
    path: '/teacher/home',
    name: 'TeacherHome',
    component: () => import('@/views/Teacher/Home.vue'),
    meta: {
      needLogin: true
    }
  },
  // 其他路由
  {
    path: '/AskToLogin',
    name: 'AskToLogin',
    component: () => import('@/components/error/AskToLogin.vue')

  },
  {
    // 404错误页面，所有业务路由必须放置在此理由之上
    // 匹配所有路径，vue2使用*，vue3使用/:pathMatch(.*)或者/:catchAll(.*)
    path: '/:catchAll(.*)',
    name: '404',
    component: () => import('@/components/error/404.vue')
  }
]
